package com.yh.service.impl;

import com.yh.dao.AdminDao;
import com.yh.model.Admin;
import com.yh.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by YH on 2017/8/29.
 */

@Service
public class AdminServiceImpl implements AdminService{

    @Autowired
    private AdminDao adminDao;

    /**
     * 用户信息查询
     * @param userName
     * @return
     */
    public Admin findByName(String userName) {
        return adminDao.findByName(userName);
    }


    /**
     * 用户登录
     * @param userName
     * @param password
     * @return
     */
    public Admin findByNameAndPassword(String userName,String password){
        return adminDao.findByNameAndPassword(userName,password);
    }

    /**
     * 添加管理员
     * @param userName
     * @param password
     * @return
     */
    public int addAdminUser(String userName,String password){
        return adminDao.addAdminUser(userName, password);

    }
}
